<template>
  <div>
    <van-tabs v-model:active="active" swipeable>
      <van-tab title="上升榜">上升榜</van-tab>
      <van-tab title="洁面">
        <div class="paihang">
          <span style="margin-left: 20px; color: #72c7c6">综合</span>
          <span>热度</span>
          <span>评分</span>
          <span>价格</span>
        </div>

        <div class="liebiao">
          <ul>
            <li v-for="(item, index) in hufulist" :key="index">
              <div class="imgd"><img :src="item.imgurl" alt="" /></div>
              <div class="a1">
                <p>{{ item.title }}</p>
                <p>
                  <span>{{ item.score }}</span> <span>{{ item.stars }}</span>
                </p>
                <p>{{ item.country }}·{{ item.Price }}/{{ item.capacity }}</p>
              </div>
            </li>
          </ul>
        </div>
      </van-tab>
      <van-tab title="护肤水">内容 3</van-tab>
      <van-tab title="精华">内容 4</van-tab>
      <van-tab title="乳液">内容 4</van-tab>
    </van-tabs>
  </div>
</template>

<script>
import { getHufuApi } from "@/utils/api1.js";
import { Tab, Tabs } from "vant";
import { ref } from "vue";
import "vant/es/tab/style";
import "vant/es/tabs/style";
export default {
  setup() {
    const active = ref(1);
    return { active };
  },
  data() {
    return {
      hufulist: [],
    };
  },
  components: { VanTab: Tab, VanTabs: Tabs },

  computed: {},

  mounted() {
    this.huFu();
  },

  methods: {
    async huFu() {
      const res = await getHufuApi();
      if (res.status === 0) {
        console.log(res);
        this.hufulist = res.result;
      }
    },
  },
};
</script>

<style lang="less" scoped>
:deep(.van-tab__text--ellipsis) {
  height: 3px;
  font-size: 28px;
  font-family: PingFang;
  font-weight: bold;
  padding-bottom: 10px;
  overflow: visible;
  justify-content: center;
  display: inline-block;
  color: black;
}
:deep(.van-tabs__wrap) {
  height: 90px;
  margin-bottom: 10px;
}
.paihang {
  height: 90px;
  border-top: 1px solid #f1f1f1;
  border-bottom: 1px solid #f1f1f1;
  display: flex;
  align-items: center;

  span {
    width: 60px;
    height: 24px;
    font-size: 25px;
    font-family: PingFang;
    font-weight: bold;
    color: #999999;
    margin-right: 41px;
  }
}
.liebiao {
  ul {
    width: 100%;
    li {
      display: flex;
      height: 214px;
      border-bottom: 1px solid #f1f1f1;

      .imgd {
        display: flex;
        align-items: center;
        margin-left: 30px;

        img {
          width: 239px;
          height: 169px;
        }
      }
      .a1 {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        margin-left: 20px;

        p:nth-child(1) {
          height: 29px;
          font-size: 30px;
          font-family: PingFang;
          font-weight: bold;
          color: #333333;
          margin-top: 27px;
        }

        p:nth-child(2) {
          span:nth-child(1) {
            height: 21px;
            font-size: 28px;
            font-family: DIN;
            font-weight: bold;
            color: #68dcdc;
          }
          span:nth-child(2) {
            height: 21px;
            font-size: 28px;
            font-family: DIN;
            font-weight: bold;
            color: #68dcdc;
          }
        }
        p:nth-child(3) {
          height: 20px;
          font-size: 20px;
          font-family: PingFang;
          font-weight: bold;
          color: #999999;
          margin-bottom: 41px;
        }
      }
    }
  }
}
</style>
